<link rel="stylesheet" href="../Public/style/designer.css" />
<script>
	 function  tab_shou(id){
		 $(".choose_type").css("display","none");
		  $("#"+id).css("display","block");
		 }
		 
		 
 </script>
<div id="top">
		 <div class="head1 clear">
			 <div class="account sprite_icon" style="text-align:center; ">
                  <a href="index.php?g=Mobile&m=User&a=index" style=" color:#FFF; line-height:50px">
                 {if cookie('username')}
                  {php $user=M('User')->field('username')->where('id='.$jgsatuserid)->find()}
                  {php echo $user['username']} 
                 {else}登录
                 {/if}
                 </a>
			 </div>
			 <div class="title">找设计师</div>
			 <div class="search sprite_icon">
			     <span class="icon2 icon_com">
			 </div>
		 </div>
	 </div>
    <include file="Mobile:nav"/>
	 <div class="choose designer">
		 <ul class="choose_btn clear">
			 <li style="width:50%" class="active"><a href="index.php?g=Mobile&m=Yuyue&a=index&id=4">全部</a></li>
			<!-- <li><a href="javascript: tab_shou('city');">所在城市</a></li>-->
			 <li style="width:50%" ><a href="javascript:tab_shou('itemType');">擅长空间</a></li>
			<!-- <li><a href="javascript:tab_shou('charge');">设计收费</a></li>-->
		 </ul>

		 <!--<div class="choose_type" id="city">
		 			 <div class="clear">
		 				 <volist name="bcity_hot"  id="r" >
                           <a  href="{:unsetParam('city',$url_s)}&city={$r['id']}"> <span <?php if($_GET['city']==$r['id']){ ?> class="active" <?php } ?>>{$r['name']}</span></a>
                         </volist>
		 			 </div>
		 
		 			 <div class="center">
		 				 <a href="javascript:tab_shou(1);" class="sure">
					      关闭
				         </a>
		 			 </div>
		 </div>-->
         
         <div class="choose_type" id="itemType">
		 			 <div class="clear">
		 				<YP:list name="Label" where="genre=17" id="r" order="listorder asc" limit="50">
                           <a  href="{:unsetParam('itemType',$url_s)}&itemType={$r['id']}"> <span <?php if($_GET['itemType']==$r['id']){ ?> class="active" <?php } ?>>{$r['title']}</span></a>
                          </YP:list>
		 			 </div>
		 
		 			 <div class="center">
		 				 <a href="javascript:tab_shou(1);" class="sure">
					      关闭
				         </a>
		 			 </div>
		 </div>
         
         
         <!--<div class="choose_type" id="charge">
		 			 <div class="clear">
		 				<YP:list name="Type" where="parentid=34" order="listorder asc" id="r" limit="50">
                           <a  href="{:unsetParam('charge',$url_s)}&charge={$r['typeid']}"> <span <?php if($_GET['charge']==$r['id']){ ?> class="active" <?php } ?>>{$r['name']}</span></a>
                          </YP:list>
		 			 </div>
		 
		 			 <div class="center">
		 				 <a href="javascript:tab_shou(1);" class="sure">
					      关闭
				         </a>
		 			 </div>
		 </div>-->
         
	 </div>
     
     <div class="tab_box">
         <div class="tab1" id="tabajax">
            <volist name="list" id="v" key="k">
             <div class="mod mod1 P_color desigher_info">
                 <div class="P_com_mod clear">
                     <div class="fl pic">
                        <a href="index.php?g=Mobile&m=Homepage&a=index&id={$v.id}"><img width="74" height="74" src="{$v.avatar}" alt="" /></a>
                     </div>
                     <div class="info">
                         <div class="tittle"> <a href="index.php?g=Mobile&m=Homepage&a=index&id={$v.id}">{$v['username']}</a><a href="index.php?g=Mobile&m=Guestbookadd&a=index&designid={$v['id']}" class="bespoke">预约他</a></div>
                         <ul class="supply clear">
                            <?php $itemType=explode(",",$v['itemType']); $c="0" ?>
                             <li class="no_padding_left">所在地区: {$v['province']|jgarea=###} {$v['city']|jgarea=###}</li>
                             <li>擅长空间: <YP:list name="Label" where="genre=17" key="kk" id="r" limit="50">
                                           {if in_array($r['id'],$itemType)}
                                              {if $c<3}
                                                 {if $c!=0}|{/if}
                                                   {$r['title']}
                                               {/if}
                                               {if $c==3}
                                                   <a style=" color:#F90;" href="index.php?g=Mobile&m=Homepage&a=index&id={$v.id}">更多</a>
                                               {/if}        
                                                   <?php $c+=1;?>
                                           {/if}
                                         </YP:list>
                               </li>
                             <li class="no_border no_padding_right" style="line-height:15px; height:25px;">
                                作品：{$v.case_num}套 / 预约：{$v.yuyue_num}<br /> 收费：<YP:list name="Type" order="typeid" where="keyid=34" id="val" limit="50">
                                 <?php echo $v['charge'] == $val['typeid'] ? $val['name'] : ''; ?>
                                 </YP:list>m²</li>
                         </ul>
                     </div>
                 </div>
                 <div class="img clear">
                    <?php $arr=M('Case')->field('id,thumb_list')->where("userid=".$v['id']." and status=1")->limit('2')->select();
                          foreach($arr as $k=>$v){
                            ?>
                       <div class="pic {if $k==1}no_margin{/if}">
                        <a href="/index.php?g=Mobile&m=Case&a=show&id={$v['id']}"><img height="95" src="{$v['thumb_list']}" alt="" /></a>
                     </div>
                     <?php } ?>
                 </div>
             </div>
           </volist>  
         </div>
     
     </div>
     
     <div class="psges" name="{$url_s}&p=2">下拉加载更多</div>
     {if empty($list)}
       <div style="width:100%; height:300px;"></div>
     {/if}
     
<style>
  #footer{ display:none}
  </style>  
<script>
     $(window).scroll(function()
 
   {
  
    if ($(window).scrollTop() == $(document).height() - $(window).height())
    {
 //alert($(window).scrollTop())
         var url=$('.psges').attr("name");
		 $('.psges').html('加载中...');
	   //alert(url)
		 $.ajax({
			type:"GET",
			url: url,
			//data: "name=John&location=Boston",
			dataType:'json', //数据类型
			success: function(msg){
				if(msg.list){
					var result_len=msg.list.length;
						for(var i=0;i<result_len;i++){
							var html='';
							 html+='<div class="mod mod1 P_color desigher_info">';
							 html+='<div class="P_com_mod clear">';
							 html+='<div class="fl pic">';
							 html+='<a href="index.php?g=Mobile&m=Homepage&a=index&id='+msg.list[i].id+'">';
							 html+='<img width="74" height="74" src="'+msg.list[i].avatar+'" alt="" /></a>';
							 html+='</div>';
							 html+='<div class="info">';
							 html+='<div class="tittle"> <a href="index.php?g=Mobile&m=Homepage&a=index&id='+msg.list[i].id+'">'+msg.list[i].username+'</a><a href="index.php?g=Mobile&m=Guestbookadd&a=index&designid='+msg.list[i].id+'" class="bespoke">预约他</a></div>';
							 html+='<ul class="supply clear">';
							 html+='<li class="no_padding_left">所在地区:'+msg.list[i].p+' '+msg.list[i].c+'</li>';
							 html+='<li>擅长空间:'+msg.list[i].itemType+' </li>';
							 html+='<li class="no_border no_padding_right" style="line-height:15px; height:25px;">';
							 html+='作品：'+msg.list[i].case_num+'套 / 预约：'+msg.list[i].yuyue_num+'<br /> 收费：'+msg.list[i].charge+'</li>';
							 html+='</ul>'
							 html+='</div>';
							 html+='</div>';
							 html+='<div class="img clear">';
								  var Case=msg.list[i].Case;
								
								   if(Case){
									   Case_len=Case.length;
									 for(var n=0;n<Case_len;n++){
									   
									     if(n==1){
										 html+='<div class="pic no_margin">';
										 }else{
										 html+='<div class="pic">';	 
											 }
									  
									   html+='<a href="/index.php?g=Mobile&m=Case&a=show&id='+Case[n].id+'">';
									   html+='<img height="95" src="'+Case[n].pic+'" alt="" /></a></div>';
									 }
								   }
							 html+='</div>';
							 html+='</div>';
								
						 
						  $("#tabajax").append(html);
						}
					 $('.psges').attr('name',msg.p);
					 $('.psges').html('下拉加载更多');
					 
				}else{ $('.psges').html('没有更多');  }
				    
					
			   
			  
		}
	   
				
		});
	   
 
    }
 
   });
   </script>  